package org.rency.crawler.fetch.repository.impl;

import java.util.Collection;
import javax.annotation.Resource;
import org.rency.crawler.dal.dao.FetchPageDao;
import org.rency.crawler.domain.vo.DocDomain;
import org.rency.crawler.fetch.helper.BuilderHelper;
import org.rency.crawler.fetch.repository.FetchPageRepository;
import org.springframework.stereotype.Repository;

/**
 * 描述: ${TODO}<br>
 * 最近修改时间:2017/11/28 18:02<br>
 *
 * @author CaiyuRen
 * @version V1.0
 * @since 2017/11/28 18:02
 */
@Repository
public class FetchPageRepositoryImpl implements FetchPageRepository {

  @Resource
  private FetchPageDao     fetchPageDao;

  @Override
  public boolean save(DocDomain domain) {
    return fetchPageDao.save(BuilderHelper.convertDoc(domain));
  }

  @Override
  public boolean save(Collection<DocDomain> domains) {
    return fetchPageDao.save(BuilderHelper.convertDoc(domains));
  }

  @Override
  public long findCount() {
    return fetchPageDao.findCount();
  }

  @Override
  public long removeAll() {
    return fetchPageDao.removeAll();
  }
}
